//
//  L_AsiaNewSongWebView.m
//  音悦咖
//
//  Created by dllo on 15/7/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "L_AsiaNewSongWebView.h"
#import "BaseHeader.h"
#import "MBProgressHUD.h"
@interface L_AsiaNewSongWebView () <MBProgressHUDDelegate>

@property (nonatomic, retain) MBProgressHUD *mbProgress;
@end

@implementation L_AsiaNewSongWebView

- (void)dealloc
{
    [_mbProgress release];
    [_value release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    NSString *newSongStr = self.value;
    
    [self createProgress];

    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64)];
    [webView.scrollView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)];
    // 边缘弹动效果
    [webView.scrollView setBounces:NO];
    // 加载请求
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:newSongStr]]];
    // 添加副视图
    [self.view addSubview:webView];
    self.mbProgress.hidden = YES;
    
}


// 创建菊花加载页
- (void)createProgress
{
    self.mbProgress = [[MBProgressHUD alloc] initWithView:self.view];
    self.mbProgress.labelText = @"稍等";
    self.mbProgress.detailsLabelText = @"正在加载…";
    self.mbProgress.delegate = self;
    [self.mbProgress show:YES];
    [self.view addSubview:self.mbProgress];
}

- (void)doSomething
{
    //你要进行的一些事
    sleep(2);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
